package com.azu.bitmapworker.core;

import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;

import java.io.InputStream;

/**
 * 如何缓存图片
 */
public interface BitmapCache {

	public Bitmap addToMemory(Object data, Bitmap bitmap, BitmapDisplayConfig config);

	public Bitmap getFromMemory(Object data, BitmapDisplayConfig config);

	public void addToDisk(Object data, Bitmap bitmap, BitmapDisplayConfig config);

	public InputStream addToDisk(Object data, InputStream inputStream, BitmapDisplayConfig config);

	public InputStream getFromDisk(Object data, BitmapDisplayConfig config);

	public void postClose(Callback callback);

	public void postClear(Callback callback);

	public void clearMemoryCache();

	public long getCacheSize();

	public static interface Callback{
		void onFinished(int operationId);
	}

}
